<?php
include_once("inc/Network.php");

class Task {
	public $id;
	public $network;

	function __construct($id, $network) {
		$this->id = $id;
		$this->network = $network;
	}

	function set($data, $value) {
		$id = $this->id;
//		$this->network->send("cmd=task_set|id=$id|data=$data|value=$value\n");
		$this->network->send(
			"<?xml version=\"1.0\" encoding=\"ISO-8859-1\" ?>"
			."<packet>"
				."<cmd>task_detail_set</cmd>"
				."<id>$id</id>"
				."<data>$data</data>"
				."<value>$value</value>"
			."</packet>\r\n"
			);
	}

	function start() {
		$id = $this->id;
//		$this->network->send("cmd=task_start|id=$id\n");
		$this->network->send(
			"<?xml version=\"1.0\" encoding=\"ISO-8859-1\" ?>"
			."<packet>"
				."<cmd>task_start</cmd>"
				."<id>$id</id>"
			."</packet>\r\n"
			);
	}
}

?>
